STEP 6: Nice! We have our data. Let's make a click event we can attach to our sprites as we create them!

  • In , drag in Define Function with Docstring above where it says: MAIN FUNCTION.
  • Rename my_function() to add_click_event().
  • Change your new function's docstring to: """Attaches a click event to a sprite""".
  • Add the following parameters to add_click_event(): sprite, my_display, my_dictionary

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)